package com.es.hr.shopscore;

import javax.servlet.http.HttpServletRequest;

import com.es.common.CommonBean;
import com.es.common.CommonBiz;
import com.es.main.LoginUserBeen;
import com.opensymphony.webwork.interceptor.ServletRequestAware;
import com.opensymphony.xwork.ActionSupport;

public class ShopScoreModifyDoAction extends ActionSupport
implements ServletRequestAware{
	 HttpServletRequest request;

	public void setServletRequest(HttpServletRequest paramHttpServletRequest) {
		// TODO Auto-generated method stub
		this.request = paramHttpServletRequest;
	}
	
	public String execute() throws Exception{
		String result = "";
		String shopScoreId = this.request.getParameter("shop_score_id");
		String shopId = this.request.getParameter("shop_code");
		String shopTotalScore = this.request.getParameter("shop_totalScore");
		String starttime = this.request.getParameter("starttime");
		String endtime = this.request.getParameter("endtime");
		String tufashijianType = this.request.getParameter("tufashijian_code");
		String qitaValue = this.request.getParameter("qita_value");
		CommonBean tufa = new CommonBiz().getCommonByTypeAndCode("tufashijian", tufashijianType);
		if(tufa.getCommonCode().equals("6")){
			tufa = new CommonBean();
			tufa.setCommonCode("6");
			tufa.setCommonValue(qitaValue);
		}

		boolean rs = new ShopScoreBiz().updateShopScoreById(shopScoreId, shopId, shopTotalScore, starttime, endtime, tufa);
		String message;
		if(rs){
			message = "修改成功";
			this.request.setAttribute("message", message);
		}else{
			message = "修改失败";
			this.request.setAttribute("message", message);
		}
		result = "success";
		return result;
	}
	 

}
